
import React, { Component } from 'react'
import { Provider } from 'react-redux'

import AppNavigator from './AppNavigator'
import configureStore from './store/configureStore'

function setup():React.Component {
  class Root extends Component {

    constructor() {
      super();

      this.state = {
        // isLoading: false,
        // () => this.setState({ isLoading: false })
        store: configureStore(),
      }
    }

    render() {
      return (
        <Provider store={this.state.store}>
          <AppNavigator />
        </Provider>
      );
    }
  }

  return Root
}

export default setup
